<include file="Common/header" />
<title>栏目管理</title>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 菜单管理 
	<span class="c-gray en">&gt;</span> 菜单列表
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<div class="pd-20 text-c">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="l">
			<a class="btn btn-primary radius" onclick="system_category_add('添加菜单','add.html', '700', '480')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加菜单</a>
		</span> 
		<span class="r">共有数据：<strong>{$total}</strong> 条</span> 
	</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-hover table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="100">ID</th>
					<th width="100">排序</th>
					<th width="100">父级ID</th>
					<th>菜单名称</th>
					<th>链接地址</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if(is_array($list)){ foreach($list as $ls){ ?>
					<tr class="text-c">
						<td><input type="checkbox" name="" value=""></td>
						<td>{$ls['menu_id']}</td>
						<td>{$ls['sort']}</td>
						<td>0</td>
						<td class="text-l">{$ls['menu_name']}</td>
						<td class="text-l">---</td>
						<td class="f-14">
							<a title="编辑" href="javascript:;" onclick="system_category_edit('栏目编辑','add.html?menu_id={$lls['menu_id']}','1','700','480')" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe6df;</i>
							</a> 
							<a title="删除" href="javascript:;" onclick="article_category_del(this,'1')" class="ml-5" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe6e2;</i>
							</a>
						</td>
					</tr>
					<?php if($ls['list']) foreach($ls['list'] as $lls){ ?>
					<tr class="text-c">
						<td><input type="checkbox" name="" value=""></td>
						<td>{$lls['menu_id']}</td>
						<td>{$lls['sort']}</td>
						<td>{$lls['parent_id']}</td>
						<td class="text-l">&nbsp;&nbsp;├&nbsp; {$lls['menu_name']}</td>
						<td class="text-l">{$lls['action']}</td>

						<td class="f-14">
							<a title="编辑" href="javascript:;" onclick="system_category_edit('权限编辑','add.html?menu_id={$lls['menu_id']}','2','700','480')" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe6df;</i>
							</a> 
							<a title="删除" href="javascript:;" onclick="article_category_del(this,'2')" class="ml-5" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe6e2;</i>
							</a>
						</td>
					</tr>
					<?php } ?>
				<?php } }else{ ?>
				<tr class="text-c">
					<td colspan="10" align="center">暂无数据...</td>
				</tr>
				<?php } ?>
			</tbody>
		</table>
	</div>
</div>

<script type="text/javascript">
	/*系统-栏目-添加*/
	function system_category_add(title,url,w,h){
		layer_show(title,url,w,h);
	}
	
	/*系统-栏目-编辑*/
	function system_category_edit(title,url,id,w,h){
		layer_show(title,url,w,h);
	}
	
	/*系统-栏目-删除*/
	function system_category_del(obj,id){
		layer.confirm('确认要删除吗？',function(index){
			$(obj).parents("tr").remove();
			layer.msg('已删除!',{icon:1,time:1000});
		});
	}
</script>
</body>
</html>